﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ctrl="clr-namespace:BorderLess.Control;assembly=BorderlessControls"
                    xmlns:shell="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
                    xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
                    xmlns:chartingprimitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
                    xmlns:vsm="clr-namespace:System.Windows;assembly=WPFToolkit"
                    xmlns:Controls="clr-namespace:AC.AvalonControlsLibrary.Controls;assembly=AvalonControlsLibrary"
                    xmlns:local="clr-namespace:WPFSolution"
                    xmlns:localConverters="clr-namespace:WPFSolution.Converters">
    <SolidColorBrush x:Key="MainWindowBackground" Color="#FF639DF2" />
    <SolidColorBrush x:Key="CaptionButtonColor" Color="#FF5C524D" />

    <ControlTemplate x:Key="BorderlessWindowControlTemplate" TargetType="{x:Type Window}">
        <Border Background="{StaticResource MainWindowBackground}" CornerRadius="0" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <!-- Captions Buttons to control the window borderless-->
                <ctrl:CaptionButtons Margin="0,0,10,0" Grid.Row="0"  HorizontalAlignment="Right" Type="Full"
                                        Foreground="{StaticResource CaptionButtonColor}" FontSize="14" MarginButton="0,0,5,0"
                                        VerticalAlignment="Center" shell:WindowChrome.IsHitTestVisibleInChrome="True"/>

                <ContentPresenter Margin="6" Grid.Row="1" Content="{TemplateBinding Content}"/>
            </Grid>
        </Border>
    </ControlTemplate>

    <Style x:Key="BorderlessWindowStyle" TargetType="{x:Type Window}">
        <Setter Property="Icon" Value="/WPFSolution;component/Resource/Images/Icon.ico.png" />
        <Setter Property="FontFamily" Value="Agency FB" />
        <Setter Property="FontSize" Value="16" />
        <Setter Property="shell:WindowChrome.WindowChrome">
            <Setter.Value>
                <shell:WindowChrome
                        ResizeBorderThickness="6"
                        CaptionHeight="30"
                        CornerRadius="0"
                        GlassFrameThickness="0,0,0,1"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" Value="{StaticResource BorderlessWindowControlTemplate}"/>
    </Style>
</ResourceDictionary>